<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>源辰-零食网订单</title>
<base href="../">
<meta name="keywords" content="小吃,美食,零食,源辰" />
<meta name="description" content="各种小吃美食，应有尽有" />
<link href="images/yc.png" rel="shortcut icon" type="image/x-icon" />
<link href="css/header.css" rel="stylesheet" type="text/css" />
<link href="css/order.css" rel="stylesheet" type="text/css" />
<link href="css/index.css" rel="stylesheet" type="text/css" />
</head>

<body>
<!-- 顶部区域 -->
<header id="header">
	<div class="header_title">
		<a href="#" target="_blank" class="location">衡阳</a>
		
		<div class="header_info">
			<div class="login_info">
				<a v-if="checkLogin" href="user.html" target="_blank" title="点击登录" >您好，[{{user.nickName}}]</a>
				<a v-else href="login.htnl" target="_blank" title="点击登录" >您好,请先登录</a>
				<a href="register.html" target="_blank" title="点击注册">免费注册</a>
			</div>
			
			<div class="person_info">
				<span>|</span>
				<a href="front/order.html" target="_blank" href="order.html">我的订单</a>
				<span>|</span>
				<a href="" target="_blank">我的收藏</a>
				<span>|</span>
				<a href="" target="_blank">客服服务</a>
				<span>|</span>
				<a href="user.html" target="_blank">个人信息</a>
			</div>
		</div>
	</div>
	
	<!-- 搜索区域  -->
	<div class="search">
		<div class="search_left">
			<a href="index.html" title="首页">
				<img src="images/logo.png" />
			</a>
			
		</div>
		
		<div class="search_center">
			<div class="search_div">
				<input type="search" placeholder="请输入您要搜索的内容..." />
				<input type="button" value="搜  索" />
			</div>
		</div>
		
		<div class="search_right">
			<i>{{count}}</i>
			<a href="cart.html" target="_blank">我的购物车</a>
		</div>
	</div>
	
	<!-- 类型导航 -->
	<div class="nav">
		<a href="javascript:void(0)" :class="{selected: tno == ''}" @click="findByType('')">全部</a>
		<a :class="{selected: tno == item.tno}" v-for="item in types" href="javascript:void(0)" 
			@click="findByType(item.tno)">{{item.tname}}</a>
	</div>
	
	<div class="v_nav">
		<ul>
			<li v-for="item in types" @click="findByType(item.tno)">
				<img :src="'../' + item.pic" />
				<span :class="{selected: tno == item.tno}">{{item.tname}}</span>
			</li>
		</ul>
	</div>
</header>
     
<!-- 订单列表 -->
<div class="common_list_con clearfix" >
    <ul class="goods_list_th clearfix">
        <li class="col01">商品名称</li>
        <li class="col03">商品单位</li>
        <li class="col03">商品价格</li>
        <li class="col02">数量</li>
        <li class="col03">小计</li>		
    </ul>
</div>
<div class="order_list_con" id="order_list">
	<div v-for="order in orders">
		    <div class="order_title">
		    	<span>订单号：{{order.ono}}</span><span>下单日期： {{order.odate}}</span><span>订单总额：<b style="color:red">{{order.totalPrice}}</b> 元</span>
		    	<a href="javascript:void(0)" v-if="order.status == 1" @click="gotoPay(order.ono, order.totalPrice)" style="color: red">去支付</a>
		    	<a href="javascript:void(0)" v-else-if="order.status == 2" style="color: orange">已支付</a>
		    	<a href="javascript:void(0)" v-else-if="order.status == 3" style="color: blud">已发货</a>
		    	<a href="javascript:void(0)" v-else-if="order.status == 4" >去评价</a>
		   		<a href="javascript:void(0)" v-else style="color: green">已完成</a>
		    </div>
		    <ul class="goods_list_td clearfix" v-for="(item, index) in order.items">
		        <li class="col01">{{index + 1}}</li>			
		        <li class="col02"><img :src="'../' + item.pic"></li>
		        <li class="col03">{{item.pname}}</li>
		        <li class="col04">{{item.weight}} / {{item.unit}}g</li>
		        <li class="col04">{{item.price}}元</li>
		        <li class="col03">{{item.num}}</li>
		        <li class="col04" v-html="(item.price * item.num).toFixed(2) + '元'"></li>	
		    </ul>
	</div>
</div>    
	 
<footer>
	<div class="foot_link">
        <a href="#">关于我们</a> <span> | </span>
        <a href="#">联系我们</a> <span> | </span>
        <a href="#">招聘广告</a> <span> | </span>
        <a href="#">友情链接</a>
    </div>
    <p>CopyRight &copy; 2019 <a class="copy" href="http://www.hyycinfo.com" target="_blank">衡阳市源辰信息科技有限公司</a> All Rights Reserverd</p>
    <p>电话：0734-8355998 湘ICP备16015987号-1</p>
</footer>
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="js/show-dialog.js"></script>
<script type="text/javascript" src="js/vue.js"></script>
<script type="text/javascript" src="js/axios.js"></script>
<script type="text/javascript" src="js/qs.js"></script>
<script type="text/javascript" src="js/hander.js"></script>
<script type="text/javascript">
	let app = new Vue({
		el:"#order_list",
		data:{
			orders: []
		},
		mounted: function(){
			axios.get("order/finds").then(rt => {
				if(rt.data.code == 200 && rt.status == 200){
					this.orders = rt.data.data;
					return;
				}
				this.orders = [];
				showmsg("暂无数据...", "blue", function() {
					location.href="index.html";
				})
			})
		},
		methods: {
			gotoPay: function(ono, totalPrice){
				location.href="alipay/pay/" + ono + "/" + totalPrice;
			}
		}
	})
</script>
</body>
</html>
